package cn.aic.pointInspect.test;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import cn.aic.pointInspect.sysquery.DataProvider;
import cn.aic.pointInspect.sysquery.DataProviderImpl;
import cn.aic.pointInspect.tools.MyBatisUtil;
import cn.aic.pointInspect.tools.SidebarTree;
import cn.aic.pointInspect.tools.Util;


public class testSYS{
	Log log = LogFactory.getLog(this.getClass());
	
	public static void main(String[] args) {
		testMethod(); 
	}

	public static void testMethod() {
		//获得会话对象
//		Runtime run = Runtime.getRuntime(); 
//		long a = run.maxMemory()+run.freeMemory()-run.totalMemory();
//		System.out.println("最大内存 = " +run.maxMemory()/1024/1024);
//		System.out.println("已分配内存 = " +run.totalMemory()/1024/1024);
//		System.out.println("已分配内存中的剩余空间 = " +run.freeMemory()/1024/1024);
//		System.out.println("最大可用内存 = " + a/1024/1024);
//        SqlSession openSession = MyBatisUtil.getSession();
//    	System.out.println("===================");
//        System.out.println("已分配内存中的剩余空间 = " +run.freeMemory()/1024/1024);
//    	System.out.println("===================");
//		List deviceList = openSession.selectList("xjOrgan.queryXJOrgan",null);
//		a = run.maxMemory()+run.freeMemory()-run.totalMemory();
//		System.out.println("最大内存 = " +run.maxMemory()/1024/1024);
//		System.out.println("已分配内存 = " +run.totalMemory()/1024/1024);
//		System.out.println("已分配内存中的剩余空间 = " +run.freeMemory()/1024/1024);
//		System.out.println("最大可用内存 = " + a/1024/1024);
//		System.out.println("===================");
//		System.out.println("testSYS.testMethod()"+deviceList);

		
		
		DataProvider data = new DataProviderImpl();
		Date beginDate = new Date();
		Date endDate = Util.getString2Date("2018-06-31");
		beginDate = Util.rollDateByDay(endDate, 30, true);
		String lineGuid = "";
		String turnGuid = "";
//		String lineGuid = "1E4B0B3C-B9A3-40DB-BE33-8349D0112B1B";
//		String turnGuid = "909E368E-68F2-41D4-A330-BBAC234A94AD";
		String isDeviceChecked = "false";
		String t_organization_r_name = "";
		String t_organization_r_guid = "4EA6E9CC-676A-4F22-A84B-C0E7B4BA31BB";
		
//		查询线路
//		Map queryXJLineByOrgan = data.queryXJLineByOrgan(t_organization_r_guid);
//		List lineList = (List) queryXJLineByOrgan.get("lineList");
//		SidebarTree map = (SidebarTree) lineList.get(0);
////		查询轮次信息
//		Map queryTurnByLineInfoOfXJ = data.queryTurnByLineInfoOfXJ(map.getT_line_r_guid(), map.getT_line_r_content_guid());
//		System.out.println();
//		
////		查询缺陷数量
//		Map queryLeakChectCountOfXJ = data.queryLeakChectCountOfXJ(beginDate, endDate, turnGuid, lineGuid, isDeviceChecked, t_organization_r_name);
//		System.out.println("testSYS.testMethod()");

		
//		查询测量类型
		String t_measure_type_guid = "B1D52FA2-857F-4863-AC84-0588193BD795";
		Map queryLeakChectCountOfXJ = data.queryMeasureType(null);
		System.out.println("testSYS.testMethod()");
		
	}
}
